using System;
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
using UwinEducation.Shared.Converters;

namespace UwinEducation.Application.Dtos
{
    /// <summary>
    /// 教师假期DTO
    /// </summary>
    public class TeacherVacationDto
    {
        /// <summary>
        /// 假期ID
        /// </summary>
        public Guid Id { get; set; }

        /// <summary>
        /// 开始时间
        /// </summary>
        public DateTime StartTime { get; set; }

        /// <summary>
        /// 结束时间
        /// </summary>
        public DateTime EndTime { get; set; }

        /// <summary>
        /// 请假原因
        /// </summary>
        public string Reason { get; set; }

        /// <summary>
        /// 老师
        /// </summary>
        public TeacherDto Teacher { get; set; }


    }

    /// <summary>
    /// 创建教师假期DTO
    /// </summary>
    public class CreateTeacherVacationDto
    {
        /// <summary>
        /// 教师ID
        /// </summary>
        [Required(ErrorMessage = "教师ID不能为空")]
        public Guid TeacherId { get; set; }

        /// <summary>
        /// 开始时间
        /// </summary>
        [Required(ErrorMessage = "开始时间不能为空")]
        [JsonConverter(typeof(CustomDateTimeConverter))]
        public DateTime StartTime { get; set; }

        /// <summary>
        /// 结束时间
        /// </summary>
        [Required(ErrorMessage = "结束时间不能为空")]
        [JsonConverter(typeof(CustomDateTimeConverter))]
        public DateTime EndTime { get; set; }

        /// <summary>
        /// 请假原因
        /// </summary>
        public string? Reason { get; set; }

    }

    /// <summary>
    /// 更新教师假期DTO
    /// </summary>
    public class UpdateTeacherVacationDto
    {
        /// <summary>
        /// 假期ID
        /// </summary>
        [Required(ErrorMessage = "假期ID不能为空")]
        public Guid Id { get; set; }

        /// <summary>
        /// 开始时间
        /// </summary>
        [JsonConverter(typeof(CustomDateTimeConverter))]
        public DateTime? StartTime { get; set; }

        /// <summary>
        /// 结束时间
        /// </summary>
        [JsonConverter(typeof(CustomDateTimeConverter))]
        public DateTime? EndTime { get; set; }

        /// <summary>
        /// 请假原因
        /// </summary>
        public string? Reason { get; set; }

    }
} 